from django.urls import re_path
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    # 获取短信验证码
    re_path('^sms_codes/(?P<mobile>\d+)/$',views.SmsView.as_view()),
    # 注册
    re_path('^users/$',views.RegisterView.as_view()),
    # 登录
    re_path('^authorizations/$', obtain_jwt_token),
    # 上传图片
    re_path(r'^upload/avatar/$', views.UserAvatarView.as_view()),
    #修改密码
    # re_path(r'^user/password/$', views.PassWordxg.as_view()),
    #关注和取关
    re_path(r'^users/like/(?P<pk>\d+)/$', views.LikeView.as_view()),
    #掉头发文本传图
    re_path(r'^upload/common/$',views.CommonView.as_view())




    # re_path('^user/$', views.UserView.as_view),

]
from rest_framework.routers import DefaultRouter, SimpleRouter

# 可以处理视图的路由器
router = SimpleRouter()
# 用户中心
router.register(r'user', views.UserView,basename='user')
#追加路由
urlpatterns += router.urls